
class Solution:
    """
    思路：
     123 * 99
    """

    def __init__(self):
        self.map = {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5,
                    "6": 6, "7": 7, "8": 8, "9": 9, "0": 0}

    def multiply(self, num1: str, num2: str) -> str:
        if num1 == "0" or num2 == "0":
            return "0"
        return str(self.get_int(num1) * self.get_int(num2))

    def get_int(self, s: str) -> int:
        res = 0
        for index, value in enumerate(s):
            res += self.map[value] * 10 ** (len(s) - index - 1)
        print(res)
        return res


def test1():
    assert Solution().multiply("0", "123") == "0"


def test2():
    assert Solution().multiply("1", "123") == "123"


def test3():
    assert Solution().multiply("321", "123") == "39483"


if __name__ == "__main__":
    print(Solution().multiply("99", "123"))
